package correct.day17;

import java.util.Scanner;

public class Test333 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        long[] a = new long[n + 1];
        long[] b = new long[n + 1];
        for (int i = 0; i <= n; i++) {
            a[i] = scanner.nextInt();
        }
        for (int i = 0; i <= n; i++) {
            b[i] = scanner.nextInt();
        }

        long hSum = 0;
        long sSum = 0;
        long hMax = 0;
        long sMin = 0;
        int left = 1;
        int right = 1;
        int begin = 0;
        while (right <= n) {
            hSum += a[right];
            sSum += b[right];

            if (right - left + 1 == k) {
                if (hSum > hMax) {
                    hMax = hSum;
                    begin = left;
                    sMin = sSum;
                }
                if (hSum == hMax && sSum < sMin) {
                    begin = left;
                    sMin = sSum;
                }
            }

            right++;
            if (right - left + 1 > k) {
                hSum -= a[left];
                sSum -= b[left];
                left++;
            }
        }
        System.out.println(begin);
    }
}
